package com.rran.study.chat.server.accept;

import com.rran.study.chat.server.core.annotations.Accept;
import com.rran.study.chat.server.core.annotations.AcceptMapping;
import com.rran.study.chat.server.dto.request.GroupChatMsg;
import com.rran.study.chat.server.dto.request.SingleMsg;
import com.rran.study.chat.server.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yy
 * @Type SingleAccept.java
 * @Desc
 * @date 2020/8/9 16:16
 */
@AcceptMapping(value = "/chat")
@Accept
@Component
public class ChatAccept {

    @Autowired
    private ChatService singleChatService;

    /**
     * 单聊
     * @param msg
     */
    @AcceptMapping(value = "/single")
    public void singleChat(SingleMsg msg){
        singleChatService.singleChat(msg);
    }

    /**
     * 群聊
     * @param msg
     */
    @AcceptMapping(value = "/group")
    public void groupChat(GroupChatMsg msg){
        singleChatService.groupChat(msg);
    }

}
